package com.forlove.app.manager.async;

import android.content.Context;
import android.support.v4.content.AsyncTaskLoader;

import com.alibaba.fastjson.JSON;
import com.forlove.app.manager.AccountInfoManager;
import com.forlove.app.qselect.login.entity.DataDto;

/**
 * Created by yjl on 2017/10/27.
 */

public class LoadUserinfoAsync extends AsyncTaskLoader<DataDto> {
    public static final int ASYNC_ID = 2005;

    public LoadUserinfoAsync(Context context) {
        super(context);
    }

    @Override
    public DataDto loadInBackground() {
        String data = AccountInfoManager.getJson("json/user_info_data.json", getContext());

//        JSONArray jsonArray = JSONArray.parseArray(citys);
        DataDto dto = JSON.parseObject(data, DataDto.class);
//        SortedMap<String, DataInfoEntity> cits = dto.getCitys();
//        List<ProvinceEntity> provinceEntities =new ArrayList<>();
//
//        ProvinceEntity provinceEntity =new ProvinceEntity();
        return dto;
    }

    @Override
    protected void onStartLoading() {
        super.onStartLoading();
        forceLoad();
    }


}

